from django.urls import path
from users import views
from rest_framework import routers
from users.views import HouseListingSearchViewSet
from users import views_alipay

router = routers.DefaultRouter()
router.register(r'search', HouseListingSearchViewSet, basename='house-search')
urlpatterns = [
    path('send_code/', views.Send_Message.as_view()),
    path('imagecode/', views.ImageCodeCheckView.as_view()),
    path('code_login/', views.Code_Login.as_view()),
    path('password_login/', views.password_Login.as_view()),
    path('register/', views.Register.as_view()),
    path('dingtalk/callback/', views.DingTalkLogin.as_view()),
    path('logout/', views.Logout.as_view()),
    path('retoken/',  views.ReToken.as_view()),
    path('userinfo/', views.UserInfo.as_view()),
    path('qiniu/token/', views.QiniuTokenView.as_view()),
    path('update_profile/', views.UpdateProfileView.as_view()),
    path('idcard/recognize/', views.IDCardRecognitionView.as_view()),
    path('real_name_auth/', views.RealNameAuthView.as_view()),
    path('house/list/', views.HouseListingAPI.as_view()),
    path('house/', views.HouseDetailAPI.as_view()),
    path('house/type/', views.HouseTypeAPI.as_view()),
    path('house/recommend/', views.HouseRecommendAPI.as_view()),
    path('cart/', views.CartView.as_view()),
    path('cart/add/', views.AddCartView.as_view()),
    path('cart/check/', views.CheckCartView.as_view()),
    path('contract/create/', views.ContractCreateView.as_view()),
    path('contract/get/', views.ContractView.as_view()),
    path('order/create/', views.OrderCreateView.as_view()),
    path('house/search/', views.SearchData.as_view()),

    path('order/create/', views.OrderCreateView.as_view()),
    # 支付宝相关接口
    # path('api/alipay/create_order', views_alipay.create_order, name='create_alipay_order'),
    # path('api/alipay/notify', views_alipay.alipay_notify, name='alipay_notify'),
    # path('api/alipay/return', views_alipay.alipay_return, name='alipay_return'),
    # path('api/alipay/query_order', views_alipay.query_order_status, name='query_alipay_order'),
    path("api/comments/", views.MovieCommentAPI.as_view()),

]
urlpatterns += router.urls


